package com.hongyue.dey06;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class kehud {
    public static void main(String[] args) throws IOException {
        String ku = "aaa,bbb";
        ServerSocket ss = new ServerSocket(10086);
        Socket acc = ss.accept();
        InputStream is = acc.getInputStream();
        OutputStream os = acc.getOutputStream();
        byte[] bys = new byte[1024];
        int read = is.read(bys);
        if (ku.equals(new String(bys, 0, read))) {
            os.write("恭喜你登录成功".getBytes());
        } else {
            os.write("登录失败".getBytes());
        }
    }
}
